package org.scub.foundation.fournisseur.egicom.core.model;

import java.util.Calendar;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;

import org.scub.foundation.framework.core.model.BaseModel;


/**
 * Entité persistante modélisant les fournisseurs.
 * @author E-GICOM
 */
@Entity
@Table(name = "fournisseur")
public class Fournisseur extends BaseModel {

    private static final long serialVersionUID = 1648642991406224637L;

    @Column(nullable = false)
    private String nom;

    @Column(nullable = false)
    private String prenom;

    @Column(nullable = false)
    private String email;

    @Column(nullable = false)
    private String adresse;

    @Column(nullable = false)
    private String telephone;

    @Column(name = "date_naissance")
    private Calendar dateNaissance;

    @Column(nullable = false)
    private String sexe;

    @Column(nullable = false, name = "num_compte_banque")
    private Integer numCompteBanquaire;

    @OneToOne
    @JoinColumn(name = "id_fournisseur", referencedColumnName = "ID")
    private Compte compte;

    /**
     * {@inheritDoc}
     */
    @Override
    public boolean equals(Object other) {
        if (other == null || !(other instanceof Fournisseur)) {
            return false;
        }
        return equalsUtil(other);
    }

    @Override
    public int hashCode() {
        return super.hashCode();
    }

    /**
     * Get the value of nom.
     * @return the nom
     */
    public String getNom() {
        return nom;
    }

    /**
     * Set the value of nom.
     * @param nom the nom to set
     */
    public void setNom(String nom) {
        this.nom = nom;
    }

    /**
     * Get the value of prenom.
     * @return the prenom
     */
    public String getPrenom() {
        return prenom;
    }

    /**
     * Set the value of prenom.
     * @param prenom the prenom to set
     */
    public void setPrenom(String prenom) {
        this.prenom = prenom;
    }

    /**
     * Get the value of telephone.
     * @return the telephone
     */
    public String getTelephone() {
        return telephone;
    }

    /**
     * Set the value of telephone.
     * @param telephone the telephone to set
     */
    public void setTelephone(String telephone) {
        this.telephone = telephone;
    }

    /**
     * Return the value of dateNaissance.
     * @return the dateNaissance
     */
    public Calendar getDateNaissance() {
        return dateNaissance;
    }

    /**
     * Modify the value of dateNaissance.
     * @param dateNaissance the dateNaissance to set
     */
    public void setDateNaissance(Calendar dateNaissance) {
        this.dateNaissance = dateNaissance;
    }

    /**
     * Get the value of emails.
     * @return the emails
     */
    public String getEmail() {
        return email;
    }

    /**
     * Set the value of email.
     * @param email the email to set
     */
    public void setEmail(String email) {
        this.email = email;
    }

    /**
     * Get the value of emails.
     * @return the emails
     */
    public String getAdresse() {
        return adresse;
    }

    /**
     * Set the value of adresse.
     * @param adresse the adresse to set
     */
    public void setAdresse(String adresse) {
        this.adresse = adresse;
    }

    /**
     * Get the value of emails.
     * @return the emails
     */
    public String getSexe() {
        return sexe;
    }

    /**
     * Set the value of sexe.
     * @param sexe the sexe to set
     */
    public void setSexe(String sexe) {
        this.sexe = sexe;
    }

    /**
     * Get the value of emails.
     * @return the emails
     */
    public Integer getNumCompteBanquaire() {
        return numCompteBanquaire;
    }

    /**
     * Set the value of umCompteBanquaire.
     * @param numCompteBanquaire the numCompteBanquaire to set
     */
    public void setNumCompteBanquaire(Integer numCompteBanquaire) {
        this.numCompteBanquaire = numCompteBanquaire;
    }

    /**
     * Get the value of emails.
     * @return the emails
     */
    public Compte getCompte() {
        return compte;
    }

    /**
     * Set the value of compte.
     * @param compte the compte to set
     */
    public void setCompte(Compte compte) {
        this.compte = compte;
    }
}
